-
Notifications
You must be signed in to change notification settings - Fork 763
Change SumoBot to deleted_user #6537
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change SumoBot to deleted_user #6537
Conversation
86ee65a
to
dd86833
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Overview
This PR aims to change the display name for a deleted user from "SumoBot" to "deleted user" in the messaging system to avoid confusion. The key changes include adding an "is_bot_user" flag in the view context and updating the helper function _add_recipients to include the flag for recipients.
Reviewed Changes
File | Description |
---|---|
kitsune/messages/views.py | Updated view context and helper function to add is_bot_user flag |
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
9ed6fcb
to
24c1360
Compare
I moved the logic to the view, and appended |
24c1360
to
ed43cee
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Overview
This PR updates the messaging views to mark messages from a deleted user by flagging them as a bot user.
- Updated the inbox and read views to set an is_bot_user flag for senders matching the SumoBot username.
- Modified the read-outbox view and _add_recipients helper to assign the is_bot_user flag for recipients.
Reviewed Changes
File | Description |
---|---|
kitsune/messages/views.py | Added logic in multiple views to flag users as bot users based on their username, supporting the change of SumoBot to deleted user in the messaging system. |
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (4)
kitsune/messages/views.py:35
- [nitpick] The attribute 'is_bot_user' is used to determine if a message is from a deleted user, which can be ambiguous. Consider renaming it to 'is_deleted_user' for clarity in the context of the PR.
message.sender.is_bot_user = message.sender.username == settings.SUMO_BOT_USERNAME
kitsune/messages/views.py:50
- [nitpick] Using the 'is_bot_user' designation here may be confusing given the PR's intent to represent deleted users. It may be clearer to use 'is_deleted_user' consistently.
if message.sender.username == settings.SUMO_BOT_USERNAME:
kitsune/messages/views.py:74
- [nitpick] The naming 'is_bot_user' might be misleading in the context of marking deleted users. Consider renaming it to 'is_deleted_user' for consistency across the application.
user.is_bot_user = user.username == settings.SUMO_BOT_USERNAME
kitsune/messages/views.py:229
- [nitpick] Since this flag is ultimately meant to represent a deleted user, renaming 'is_bot_user' to 'is_deleted_user' would improve clarity in the codebase.
msg.recipient.is_bot_user = msg.recipient.username == settings.SUMO_BOT_USERNAME
@smithellis with the #6559 merged, this needs an update |
ed43cee
to
48fe64a
Compare
2d3a117
to
9e94a68
Compare
* In messaging, when a user who received a message is deleted the sending users outbox will now show the message was to deleted user * When a message in your inbox is from a user who is deleted it will appear as being from deleted user
9e94a68
to
c981b19
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is almost done. Extracting the check to a method/filter/function and removing the addition of sumobot to the group should do it. Let me know when it's ready for a final pass
outbox_messages = OutboxMessage.objects.filter(to=user) | ||
for message in outbox_messages: | ||
message.to.remove(user) | ||
message.to.add(sumo_bot) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the point of assigning these messages to SuMoBot? Good clean up work on removing the user from the recipient list
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If userA sent a message to userB and userB gets deleted, the message in userA's Outbox needs to have a 'To' person - thus the reassignment.
a62ee82
to
7d5597c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Please squash into a single commit before merging
SumoBot isn't a meaningful name in the messaging system for a user who is deleted, and could cause confusion.
deleted user
.mozilla/sumo#2225